1. Lexical Analysis and Morphological
• The first phase of NLP is the Lexical Analysis.
• This phase scans the source code as a stream of characters and converts it into meaningful lexemes. The
validity of words are checked according to lexicon.
• Lexicon stands for dictionary, is a collection of all possible valid words of the language along with their
meaning.
• Lexicon provides all necessary rules and data for carrying out the first state analysis.
• It divides the whole text into paragraphs, sentences, and words.
• The details of words, like their type ( noun, verb & adverb, and other details of nouns & verb etc.) are
checked.
2. Syntactic Analysis (Parsing)
• Syntax refers to the study of formal relationships between words of sentences. In this phase the validity of
a sentence checked according to grammar rules.
• To perform the syntactic analysis, the knowledge of grammar and parsing technique is required.
• The grammar is formal specification of rules allowable in the language, and parsing is a method of
analyzing a sentence to determines its structure according to grammar.
• Syntactic analysis is done using parsing. Two basic parsing techniques are used: top-down parsing and
bottom-up parsing.